//
//  MovieListViewController.h
//  Kokozu
//
//  Created by Bismarrck on 11-7-12.
//  Copyright 2011年 Tsinghua University. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MovieDetailViewController.h"
#import "KKZBaseCell.h"
#import "EGORefreshTableHeaderView.h"
#import "LocationViewController.h"
#import "TableFooterCell.h"
#import "MovieRecord.h"
#import "UIViewController+BarItem.h"

typedef enum {
    
    NORMAL_CELL,
    EXPAND_CELL
    
} CellState;

@interface MovieListViewController : UITableViewController 
    <EGORefreshTableHeaderDelegate, TableFooterDelegate>
{
    // EGORefreshHeader
    EGORefreshTableHeaderView *refreshTableHeaderView_;
    BOOL isReloading_;
    
    // TableViewFooter
    TableFooterCell *tableFooterCell_;
    
    // Table View Cell Related
    UINib *normalCellNib_;
    UINib *expandCellNib_;
    KKZBaseCell *normalTmpCell_;
    KKZBaseCell *expandTmpCell_;
    NSIndexPath *selectedIndexPath_;
    NSUInteger rowsCount_;
    BOOL cellIsExpanded;
    
    NSArray *locationCircles;
}

@property (nonatomic, retain) UINib *normalCellNib;
@property (nonatomic, retain) UINib *expandCellNib;
@property (nonatomic, retain) IBOutlet KKZBaseCell *normalTmpCell;
@property (nonatomic, retain) IBOutlet KKZBaseCell *expandTmpCell;
@property (nonatomic, retain) NSIndexPath *selectedIndexPath;
@property (nonatomic, assign) BOOL cellIsExpanded;
@property (nonatomic, assign) NSUInteger rowsCount;
@property (nonatomic, retain) TableFooterCell *tableFooterCell;
@property (nonatomic, retain) NSArray *locationCircles;

- (void)configureCell:(KKZBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath options:(CellState)state;
- (MovieDetailViewController *)nextViewControllerForIndexPath:(NSIndexPath *)indexPath;
- (void)accessoryButtonTapped;
- (UINib *)normalCellNib;
- (UINib *)expandCellNib;
- (CGFloat)normalCellHeight;
- (CGFloat)expandCellHeight;

@end
